package org.example.test1;

import java.util.Random;

public class Computer {
    String name;
    int score;
    //计算机出拳
    public int showFist(){
        Random random = new Random();
        int num = random.nextInt(2)+1;
        switch (num) {
            case 1:
                System.out.println(this.name+"出拳: 剪刀");
                break;
            case 2:
                System.out.println(this.name+"出拳: 石头");
                break;
            case 3:
                System.out.println(this.name+"出拳: 布");
                break;
            default:
                System.out.println("false");
        }
        return num;
    }
}
